from socket import *
from multiprocessing import *

mySocket = socket(AF_INET, SOCK_STREAM)


mySocket.setsockopt(SOL_SOCKET,SO_REUSEADDR,1)

localAddr = ('',7788)

mySocket.bind(localAddr)

mySocket.listen(5)

mySocket.setblocking(False)

clientlist=[]

while True:
    print('')
    try:
        newSocket,destAddr = mySocket.accept()
    except:
        pass
    else:
        newSocket.setblocking(False)
        clientlist.append((newSocket,destAddr))

    for clientSocket,clientAddr in clientlist:
        try:
            clientData = clientSocket.recv(1024)
        except:
            pass
        else:
            if len(clientData)>0:
                print("")
            else:
                clientSocket.close()
                clientlist.remove((clientSocket,clientAddr))

